﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleRayTracer
{
    class Light
    {
        public Vector3D centre;
        public double clR = 0;
        public double clG = 0;
        public double clB = 0;

        public Light(Vector3D centre)
        {
            this.centre = centre;
        }

        public double GetColourDiff(Vector3D pi, Vector3D normal)
        {
            Vector3D L = centre - pi;
            L = Vector3D.Normv(L);

            Vector3D N = normal;

            double dot = Vector3D.Dot(N, L);

            if (dot > 0)
            {
                return dot;
            }

            return 0.0;
        }

        public void Move(Vector3D trans)
        {
            centre.x += trans.x;
            centre.y += trans.y;
            centre.z += trans.z;
        }

        public void MoveTo(Vector3D dest)
        {
            centre.x = dest.x;
            centre.y = dest.y;
            centre.z = dest.z;
        }
    }
}
